package cn.edu.ctbu.firsthello.service;

import cn.edu.ctbu.firsthello.dao.StudentRepository;
import cn.edu.ctbu.firsthello.domain.Student;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class StudentService {

    @Autowired
    private StudentRepository studentRepository;

    public List<Student> findAll(){

        return studentRepository.findAll();
    }

    public List<Student> findByNameLike(String name){

        return studentRepository.findByNameLike(name);
    }

    public List<Student> findByMaxAge(){

        return studentRepository.findByMaxAge();
    }



    public List<Student> findByNameScore(String name,Integer score){

        return studentRepository.findByNameScore(name,score);
    }




}
